/**
 * WhiMAIcpp - C++ interface for the Whiskey Media API's.
 *  Copyright (C) 2010  Anders Bugge
 *
 *  Data created and powered by:
 *  Whiskey Media	http://www.whiskeymedia.com/
 *  Giant Bomb		http://www.giantbomb.com/
 *  Comic Vine		http://www.comicvine.com/
 */

#ifndef SEARCH_H_
#define SEARCH_H_

#include "list.h"

namespace WM
{

namespace GB
{

class Search : public List
{
public:
	Search();
	/**
	 * This constructor searches for the specified query
	 * @param query The query string
	 * @param offset Offset in the search result
	 * @param limit The maximum number of results (maximum is 20)
	 * @param ok Optional, set to false if any error occurs else true
	 */
	Search( std::string query, unsigned int offset, unsigned int limit, bool* ok = 0 );
	virtual ~Search();

	/**
	 * Set the query string
	 * @param value Query
	 */
	void setQuery( std::string value );

	/**
	 * Set the resources string
	 * @param value Resources, separate resources with ","
	 */
	void setResources( std::string value );

private:
	std::string query; ///< The query string
	std::string resource; ///< The resources to search in
	void updateExtraUrl(); ///< Update the extra url
};

}

namespace CV
{

class Search : public List
{
public:
	Search();
	/**
	 * This constructor searches for the specified query
	 * @param query The query string
	 * @param offset Offset in the search result
	 * @param limit The maximum number of results (maximum is 20)
	 * @param ok Optional, set to false if any error occurs else true
	 */
	Search( std::string query, unsigned int offset, unsigned int limit, bool* ok = 0 );
	virtual ~Search();

	/**
	 * Set the query string
	 * @param value Query
	 */
	void setQuery( std::string value );

	/**
	 * Set the resources string
	 * @param value Resources, separate resources with ","
	 */
	void setResources( std::string value );

private:
	std::string query; ///< The query string
	std::string resource; ///< The resources to search in
	void updateExtraUrl(); ///< Update the extra url
};

}

}

#endif /* SEARCH_H_ */
